#include <pthread.h>
#include <stdio.h>

pthread_t tid;

void printids(const char* str){
	pid_t pid;
	pthread_t tid;

	pid = getpid();
	tid = pthread_self();
	printf("%s, pid=%d,tid=0x%x\n",str, (unsigned int )pid,(unsigned int)tid);
}

void* thread_fn(void* arg){
	char* str = (char*)arg;
	printf("thread_fn,arg=%s\n",str);
	printids("new thread:");
}

void main(void){
	tid = pthread_create(&tid,NULL,thread_fn,"abc");
	printids("main thread:");
	sleep(1);
}